package org.muxiao.seckill.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 自定义响应状态码枚举类
 */
@Getter
@ToString
@AllArgsConstructor
public enum RespBeanEnum implements Serializable {

    //通用
    SUCCESS(200, "success"),
    ERROR(500, "服务端异常"),

    EMPTY_ERROR(500100, "数据为空"),
    UNKNOWN_EXCEPTION(555, "未知异常"),

    //登录
    LOGIN_ERROR(500210, "用户 id 或 密码错误"),
    MOBILE_ERROR(500211, "手机号码格式不正确"),
    BIND_ERROR(500212, "参数绑定异常"),
    MOBILE_NOT_EXIST(500213, "手机号码不存在"),
    PASSWORD_UPDATE_ERROR(500214, "密码更新失败"),

    //秒杀模块
    ENTRY_STOCK(500500, "库存不足"),
    REPEAT_ERROR(500501, "该商品每人限购一件"),
    REQUEST_ILLEGAL(500502,"请求非法"),
    SESSION_ERROR(500503,"用户信息有误"),
    SEC_KILL_WAIT(500504,"秒杀排队中..."),
    CAPTCHA_ERROR(500505,"验证码校验失败..."),
    ACCESS_LIMIT_ERROR(500506,"访问频繁,请稍候再试..."),
    SEC_KILL_RETRY(500507,"本次抢购失败, 请继续抢购...");

    private final Integer code;
    private final String message;
}
